{% extends "base_navigation.html" %}
{% load static %}
<!DOCTYPE html>
<html lang="en">

<head>
    {% block head_part %}
        <title>定时任务概览</title>
        <link rel="stylesheet" href="{% static 'Form_Style/css/style-nav.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'bootstrap-3.3.7-dist/css/bootstrap.min.css' %}">
    {% endblock %}
</head>

<body>
  {% block user_who %}| User：{{ username }}{% endblock user_who %}
  {% block body_part %}
      <article style="top: 20%">
      <table class="table table-hover">
          <thread>
              <tr>
                   <th>总用例</th>
                   <th>任务设立时间</th>
                   <th>下次运行时间</th>
                   <th>时间间隔</th>
                   <th>绑定邮箱</th>
                   <th>删除任务</th>
              </tr>
          </thread>
          {% for tmp_job,tmp_file in zip_data %}
              <tr>
                <td>{{ tmp_file.name }}</td>
                <td>{{ tmp_job.id }}</td>
                <td>{{ tmp_job.next_run_time }}</td>
                <td>{{ tmp_job.trigger.interval }}</td>
                 <td>{% for tmp in tmp_file.email_data.all %}
                        {{ tmp.email_address }}
                     <br>
                     {% endfor %}
                     </td>
                  <td>
                      <button type="button" class="btn btn-primary btn-sm" href="{% url "file_manage:remove_task" tmp_job.id %}" onclick="resp_confirm(this)">删除该任务</button>
                  </td>
{#                   <td> <a href="{% url "file_manage:remove_task" tmp_file.pk %}" onclick="confirm('确认删除吗？')">删除该任务</a></td>#}
{#                <td> <button type="button" class="btn btn-primary btn-sm">删除文件</button></td>#}
              </tr>
          {% endfor %}
      </table>
      </article>
      <script  src="{% static 'Form_Style/download_js/script-nav.js' %}"></script>
      <script>
            　　function resp_confirm(tmp){
            　　　　if (confirm('确认删除吗？')){
                      window.top.location.href=tmp.getAttribute("href")
                }

            　　}
      </script>
  {% endblock %}

</body>
</html>